{{#useBeanValidation}}@Validated{{/useBeanValidation}}
{{#discriminator}}{{/discriminator}}
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} {
  {{#serializableModel}}
  private static final long serialVersionUID = 1L;
  {{/serializableModel}}

  {{#vars}}
  {{#isEnum}}
  {{^isContainer}}
  {{>enumClass}}
  {{/isContainer}}
  {{/isEnum}}
  {{#items.isEnum}}
  {{#items}}
  {{^isContainer}}
  {{>enumClass}}
  {{/isContainer}}
  {{/items}}
  {{/items.isEnum}}
  {{#gson}}
  @SerializedName("{{baseName}}")
  {{/gson}}
  {{#isContainer}}
  {{#useBeanValidation}}@Valid{{/useBeanValidation}}
  private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
  {{/isContainer}}
  {{^isContainer}}
    private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}} {{/defaultValue}}{{/required}};
  {{/isContainer}}
  {{/vars}}

  {{#vars}}
  public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
    this.{{name}} = {{name}};
    return this;
  }

  {{#isListContainer}}
  public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
  {{^required}}
    if (this.{{name}} == null) {
      this.{{name}} = {{{defaultValue}}};
    }
  {{/required}}
    this.{{name}}.add({{name}}Item);
    return this;
  }
  {{/isListContainer}}

  {{#isMapContainer}}
  public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
  {{^required}}
    if (this.{{name}} == null) {
      this.{{name}} = {{{defaultValue}}};
    }
  {{/required}}
    this.{{name}}.put(key, {{name}}Item);
    return this;
  }
  {{/isMapContainer}}

  {{#vendorExtensions.extraAnnotation}}
  {{{vendorExtensions.extraAnnotation}}}
  {{/vendorExtensions.extraAnnotation}}
  {{#useBeanValidation}}
  {{>beanValidation}}
  {{/useBeanValidation}}
  public {{{datatypeWithEnum}}} {{#isBoolean}}is{{/isBoolean}}{{getter}}() {
    return {{name}};
  }

  public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
    this.{{name}} = {{name}};
  }
{{/vars}}
}